from utils.Segment import Seg


class SentenceHandler(object):

    seg = Seg()

    def __init__(self,sentence, id = 0):
        self.id = id
        self.originSentence = sentence
        self.cutSentence = self.cut(self.seg)
        self.score = None

    # 对句子分词
    def cut(self, seg):
        return seg.cut_for_search(self.originSentence)

    # 获取切词后的词列表
    def get_cut_sentence(self):
        return self.cutSentence

    # 获取原句子
    def get_origin_sentence(self):
        return self.cutSentence

    # 设置该句子得分
    def set_score(self,score):
        self.score = score